// pins for spi ssd1306
#define CS_PIN  -1
#define RST_PIN 33
#define DC_PIN  32

//pins for rotary and button
#define ROTARY_PIN1  25
#define ROTARY_PIN2 26
#define BUTTON_PIN  27
#define CLICKS_PER_STEP   4    // this number depends on your rotary encoder 

//EEPROM
#define BRIGHTNESS_SET_ADDR 0
#define MONITOR_AUTO_CONTROL_ADDR 4
#define EEPROM_SIZE 6

//brightness auto control flag  255-auto  0-manual
#define BRIGHTNESS_AUTO 255
#define BRIGHTNESS_MANUAL 0

//manual set Brightness Range
#define BRIGHTNESS_LOW 1
#define BRIGHTNESS_HIGH 4

//screen light level
#define BRIGHTNESS_LEVEL1 1
#define BRIGHTNESS_LEVEL2 2
#define BRIGHTNESS_LEVEL3 3
#define BRIGHTNESS_LEVEL4 4

// used for getting bilibili fans number
// tutorial: https://www.bilibili.com/video/BV17V411q7oG?p=2
String FANS_URL = "http://api.bilibili.com/x/relation/stat?vmid=YOURID";

#define BILIBILI_BMP_width 44
#define BILIBILI_BMP_height 42
static unsigned char BILIBILI_BMP_bits[] = {
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x60, 0x00, 0x00,
   0x00, 0xf0, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0x00,
   0x00, 0xf0, 0x01, 0xf8, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x7c, 0x00, 0x00,
   0x00, 0xc0, 0x03, 0x3c, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x7f, 0x00,
   0xf0, 0xff, 0xff, 0xff, 0xff, 0x00, 0xf8, 0x00, 0x00, 0x00, 0xe0, 0x01,
   0x1c, 0x00, 0x00, 0x00, 0x80, 0x03, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x07,
   0x06, 0xff, 0xff, 0xff, 0x0f, 0x06, 0x86, 0x01, 0x00, 0x00, 0x18, 0x06,
   0xc6, 0x00, 0x00, 0x00, 0x30, 0x06, 0x46, 0x00, 0x00, 0x00, 0x20, 0x06,
   0x46, 0x00, 0x00, 0x00, 0x20, 0x06, 0x46, 0x00, 0x00, 0x00, 0x20, 0x06,
   0x46, 0x00, 0x00, 0x00, 0x20, 0x06, 0x46, 0x80, 0x03, 0x1c, 0x20, 0x06,
   0x46, 0xf0, 0x03, 0x7e, 0x20, 0x06, 0x46, 0xfc, 0x03, 0xf8, 0x23, 0x06,
   0x46, 0x3c, 0x00, 0xe0, 0x23, 0x06, 0x46, 0x08, 0x00, 0x80, 0x21, 0x06,
   0x46, 0x00, 0x00, 0x00, 0x20, 0x06, 0x46, 0x00, 0x62, 0x04, 0x20, 0x06,
   0x46, 0x00, 0x22, 0x04, 0x20, 0x06, 0x46, 0x00, 0x62, 0x04, 0x20, 0x06,
   0x46, 0x00, 0x9c, 0x03, 0x20, 0x06, 0x46, 0x00, 0x00, 0x00, 0x20, 0x06,
   0x46, 0x00, 0x00, 0x00, 0x20, 0x06, 0x46, 0x00, 0x00, 0x00, 0x20, 0x06,
   0x46, 0x00, 0x00, 0x00, 0x20, 0x06, 0xc6, 0x00, 0x00, 0x00, 0x30, 0x06,
   0x86, 0x01, 0x00, 0x00, 0x18, 0x06, 0x06, 0xff, 0xff, 0xff, 0x0f, 0x06,
   0x0e, 0x00, 0x00, 0x00, 0x00, 0x07, 0x1c, 0x00, 0x00, 0x00, 0x80, 0x03,
   0x78, 0x00, 0x00, 0x00, 0xc0, 0x01, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x00,
   0xc0, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };


#define MODE_NUM 4   //number of modes
#define TEMP_HUMI_MODE 3
#define BILIBILI_MODE 1
#define TIME_MODE 2
#define CHANGE_MOD 0
uint8_t screen_saver_mode = TIME_MODE;